package com.kxz.service;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer1Service {
    @JmsListener(destination = "myQueue",containerFactory = "queueListener")   //监听点对点模式
    public void receiveQueue(String message){
        System.out.println("queue接收到："+message);
    }
    @JmsListener(destination = "myTopic",containerFactory = "topicListener")//监听发布订阅式的消息
    public void receiveTopic(String message){
        System.out.println("topic接收到："+message);
    }
}
